package com.example.juctest.map_test;

import java.util.NavigableSet;
import java.util.concurrent.ConcurrentSkipListMap;

public class MyConcurrentSkipListTest {
    public static void main(String[] args) throws InterruptedException {
        ConcurrentSkipListMap<Integer,String> map=new ConcurrentSkipListMap<>();
        map.put(3,"3");
        map.put(1,"1");
        map.put(5,"13");
        map.put(4,"31");
        map.put(6,"2");
        map.put(2,"2");
        NavigableSet<Integer> integers = map.keySet();
        integers.forEach(System.out::println);
        Thread thread = new Thread(() -> {
            System.out.println(11);
            Thread thread1 = new Thread(() -> System.out.println(11));
            thread1.start();
            while (true){
                System.out.println(11);
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
        );
        thread.start();
        Thread.yield();
        System.out.println(thread.isInterrupted());
        thread.interrupt();
        System.out.println(thread.isInterrupted());
    }
}
